package com.xzwk.subject.infra.basic.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.xzwk.subject.infra.basic.mapper.SubjectCategoryDao;
import com.xzwk.subject.infra.basic.entity.SubjectCategory;
import com.xzwk.subject.infra.basic.service.SubjectCategoryService;
import java.util.List;
import javax.annotation.Resource;
import org.springframework.stereotype.Service;

/**
 * 题目分类(SubjectCategory)表服务实现类
 *
 * @author makejava
 * @since 2024-03-06 21:33:47
 */
@Service("subjectCategoryService")
public class SubjectCategoryServiceImpl extends ServiceImpl<SubjectCategoryDao, SubjectCategory> implements SubjectCategoryService {

  @Resource
  private SubjectCategoryDao subjectCategoryDao;

  @Override
  public List<SubjectCategory> queryPrimaryCategory(Long parentId) {
    QueryWrapper<SubjectCategory> queryWrapper = new QueryWrapper<>();
    queryWrapper.eq("parent_id",parentId)
        .eq("is_deleted",0);
    return subjectCategoryDao.selectList(queryWrapper);
  }
}

